package com.xcity.game.activity.login;

import com.alibaba.fastjson.annotation.JSONField;
import com.xcity.game.item.ItemTemplate;

import naga.x.App;
import naga.x.game.template.Template;
import naga.x.game.template.TemplateException;
import naga.x.game.template.TemplateService;
import naga.x.game.template.annotation.Excel;

/**
 * 每日登录奖励
 * @author yang.li
 *
 */
@Excel(value = "activity.xlsx", sheet = 0)
public class DailyLoginRewardTemplate extends Template {

	/** 物品数量 */
	protected int count;
	
	protected ItemTemplate ref;

	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}
	
	public String getName() {
		return getRef().getName();
	}

	public String getIcon() {
		return getRef().getIcon();
	}

	public String getDesc() {
		return getRef().getDesc();
	}
	
	@JSONField(serialize = false)
	public ItemTemplate getRef() {
		return ref != null ? ref : (ref = App.getApp().getServiceManager().get(TemplateService.class).get(ItemTemplate.class, id));
	}

	@Override
	public void validate() throws TemplateException {}
}
